﻿<UserControl x:Class="WPF_QC.QA_View.RunningMachinesStatus"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="800">
    <Grid Margin="0,0,0.4,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="8"/>
            <RowDefinition Height="25"/>
            <RowDefinition />
        </Grid.RowDefinitions>

        <TabControl HorizontalAlignment="Left" Height="515" Margin="10,10,0,0" VerticalAlignment="Top" Width="780" Grid.Row="2">
            <TabItem x:Name="currentSchedMyTeamTab" FontSize="12" Header="Curent Machines Running" Margin="-2,-2,-33,-1">
                <Grid Background="#FFE5E5E5" Margin="0,-1,0,0">
                    <DataGrid x:Name="dgdCurrentMchns" AutoGenerateColumns="False" Margin="10,10,0,306" SelectionChanged="dgdCurrentMchns_SelectionChanged">
                        <DataGrid.RowStyle>
                            <Style TargetType="DataGridRow">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Path=Pass_Fail}" Value="False">
                                        <Setter Property="Background" Value="Red"></Setter>
                                        <Setter Property="Foreground" Value="White"></Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </DataGrid.RowStyle>
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=MachineID}" Width="200" Header="Machine Name" />
                            <DataGridTextColumn Binding="{Binding Path=MaterialName}" Width="*" Header="Material Name" />

                            <DataGridTextColumn Binding="{Binding Path=Pass_Fail}"  Width="80" Header="Pass/Fail" />

                            <DataGridTextColumn Binding="{Binding Path=DateTaken}" Width="200" Header="Date Taken" />
                        </DataGrid.Columns>




                    </DataGrid>
                    <DataGrid x:Name="dgdSingleMchn" AutoGenerateColumns="False" HorizontalAlignment="Left" Height="250" Margin="10,224,0,0" VerticalAlignment="Top" Width="750">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=MachineID}" Width="120" Header="Machine Name" />
                            <DataGridTextColumn Binding="{Binding Path=MaterialName}" Width="120" Header="Material Name" />
                            <DataGridTextColumn Binding="{Binding Path=QCAttribID}" Width="*" Header="Measurement Attribute" />
                            <DataGridTextColumn Binding="{Binding Path=Value}" Width="90" Header="Entered Value" />
                            <DataGridTextColumn Binding="{Binding Path=Target}" Width="60" Header="Target" />
                            <DataGridTextColumn Binding="{Binding Path=Threshold}" Width="80" Header="Threshold" />
                            <DataGridTextColumn Binding="{Binding Path=Upper}" Width="60" Header="Upper" />
                            <DataGridTextColumn Binding="{Binding Path=Lower}" Width="60" Header="Lower" />
                        </DataGrid.Columns>
                    </DataGrid>
                    <Label x:Name="lblMachnselected" Content="Machine History" HorizontalAlignment="Left" Margin="343,193,0,0" VerticalAlignment="Top" FontWeight="Bold"/>

                </Grid>
            </TabItem>
            <TabItem x:Name="currentStatusMyTeamTab" FontSize="12" Header="Current Schedule - My Shift" Margin="33,-2,-62,-1">
                <Grid Background="#FFE5E5E5">
                    <DataGrid x:Name="dgdMyShift"  AutoGenerateColumns="False" Margin="10">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=MachineID}" Width="120" Header="Machine Name" />
                            <DataGridTextColumn Binding="{Binding Path=MaterialName}" Width="180" Header="Material Name" />
                            <DataGridTextColumn Binding="{Binding Path=QCAttribName}" Width="220" Header="Measurement Attribute" />
                            <DataGridTextColumn Binding="{Binding Path=Hour}" Width="80" Header="Hour" />
                            <DataGridTextColumn Binding="{Binding Path=Day}" Width="*" Header="Day" />
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
            <TabItem x:Name="currentStatusAllTab" FontSize="12" Header="Current Schedule - All Shifts" Margin="62,-2,-91,-1">
                <Grid x:Name="dgdAllShifts" Background="#FFE5E5E5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="33*"/>
                        <ColumnDefinition Width="293*"/>
                        <ColumnDefinition Width="59*"/>
                    </Grid.ColumnDefinitions>
                    <DataGrid x:Name="machinesDatagrid" HorizontalAlignment="Center" VerticalAlignment="Top" Height="473" Width="750" 
                      AutoGenerateColumns="False" Margin="10,10,10,0" Grid.ColumnSpan="3">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=MachineID}" Width="120" Header="Machine Name" />
                            <DataGridTextColumn Binding="{Binding Path=MaterialName}" Width="180" Header="Material Name" />
                            <DataGridTextColumn Binding="{Binding Path=QCAttribName}" Width="220" Header="Measurement Attribute" />
                            <DataGridTextColumn Binding="{Binding Path=Hour}" Width="80" Header="Hour" />
                            <DataGridTextColumn Binding="{Binding Path=Day}" Width="*" Header="Day" />
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
        </TabControl>
        <Label x:Name="measRptLabel" FontSize="14" Content="Running Machines Status" HorizontalAlignment="Center" VerticalAlignment="Top" 
               Width="180" FontWeight="Bold" Margin="304,0,315.6,0" Grid.Row="1" Height="26" Grid.RowSpan="2"/>

    </Grid>
</UserControl>
